/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Author: Huawei OS Kernel Lab
 * Create: Thu Aug 15 16:14:23 2023
 */

#ifndef _ASM_HIGHMEM_H
#define _ASM_HIGHMEM_H

extern unsigned long highmem_kmap_base;
#define HIGHMEM_KMAP_SIZE       (64*1024*1024)

#define PKMAP_BASE		(highmem_kmap_base)
#define LAST_PKMAP		(HIGHMEM_KMAP_SIZE >> PAGE_SHIFT)
#define LAST_PKMAP_MASK		(LAST_PKMAP - 1)

#define PKMAP_ADDR(nr)		(PKMAP_BASE + ((nr) << PAGE_SHIFT))
#define PKMAP_NR(virt)		(((virt) - PKMAP_BASE) >> PAGE_SHIFT)

#define flush_cache_kmaps()	do { } while (0)

extern void kmap_init(void);
extern int arch_highmem_page_mapped(struct page *pg);

#endif
